﻿<UserControl x:Class="BillsManager.Views.BackupCenterView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Caliburn="http://www.caliburnproject.org"
             xmlns:Controls="clr-namespace:BillsManager.Views.Controls"
             xmlns:DataTemplates="clr-namespace:BillsManager.Views.DataTemplates"
             xmlns:ViewModel="clr-namespace:BillsManager.ViewModels;assembly=BillsManager.ViewModels"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Loc="clr-namespace:BillsManager.Localization;assembly=BillsManager.Localization"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             Width="Auto"
             d:DataContext="{d:DesignInstance Type=ViewModel:BackupCenterViewModel,
                                              IsDesignTimeCreatable=True}"
             d:DesignHeight="300"
             mc:Ignorable="d">

    <UserControl.Resources>
        <!--<ResourceDictionary Source="Dictionaries\Styles.xaml" />-->
        <ResourceDictionary Source="Themes\Themes.xaml" />
    </UserControl.Resources>

    <UserControl.Background>
        <Binding Mode="OneTime" Source="{StaticResource View.Background}" />
    </UserControl.Background>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="{StaticResource View.Region.Spacing.Small}" />
            <ColumnDefinition Width="77*" />
            <ColumnDefinition Width="{StaticResource View.Region.Spacing.Small}" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="{StaticResource View.Region.Spacing.Small}" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <Menu Grid.Column="1">

            <!--
                <MenuItem Header="Refresh"
                Command="{Binding RefreshBackupGroupsCommand, Mode=OneWay}" />

                <Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
            -->

            <MenuItem Command="{Binding ActiveItem.RollbackCommand,
                                        Mode=OneWay}"
                      CommandParameter="{Binding ActiveItem.SelectedBackupViewModel}"
                      Header="{Loc:Translate Rollback}" />

            <Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />

            <MenuItem Command="{Binding ActiveItem.CreateNewBackupCommand, Mode=OneWay}" Header="{Loc:Translate NewBackup}" />
            <MenuItem Command="{Binding ActiveItem.DeleteBackupCommand,
                                        Mode=OneWay}"
                      CommandParameter="{Binding ActiveItem.SelectedBackupViewModel}"
                      Header="{Loc:Translate DeleteBackup}" />

            <Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />

            <MenuItem Command="{Binding ActiveItem.OpenBackupsFolderCommand, Mode=OneWay}" Header="{Loc:Translate OpenBackupsFolder}" />

        </Menu>

        <ContentControl x:Name="ActiveItem"
                        Grid.Row="3"
                        Grid.Column="1" />

    </Grid>
</UserControl>